﻿using System.Windows;
using AccountManagement.DataAccess;

namespace AccountManagement
{
    /// <summary>
    /// Interaction logic for FrmChi.xaml
    /// </summary>
    public partial class FrmChi : Window
    {
        private bool _isUpdate;
        private tblPhieuThuChi _objPhieuThuChi;

        public FrmChi()
        {
            InitializeComponent();
        }

        public FrmChi(tblPhieuThuChi objPhieuThuChi)
        {
            InitializeComponent();
            _isUpdate = true;

            _objPhieuThuChi = objPhieuThuChi;
            FillData(objPhieuThuChi);
        }

        private void FillData(tblPhieuThuChi objPhieuThuChi)
        {
            //try
            //{
            //    dtpNgayThang.SelectedDate = objPhieuThuChi.NgayThang;
            //    lblQuyenSo.Content = objPhieuThuChi.QuyenSo.ToString();
            //    lblPhieuSo.Content = objPhieuThuChi.PhieuSo.ToString();
            //    txtTKCo.Text = objPhieuThuChi.TKCo.ToString();
            //    txtTKNo.Text = objPhieuThuChi.TKNo.ToString();
            //    if (objPhieuThuChi.TKThue != null)
            //    {
            //        txtTKThue.Text = objPhieuThuChi.TKThue.ToString();
            //        txtThue.Text = objPhieuThuChi.Thue.ToString();
            //    }
            //    txtName.Text = objPhieuThuChi.HoTen;
            //    txtAddress.Text = objPhieuThuChi.DiaChi;
            //    txtReason.Text = objPhieuThuChi.LyDo;
            //    txtAmount.Text = objPhieuThuChi.Sotien.ToString();
            //    txtTextWrite.Text = objPhieuThuChi.VietBangChu;
            //    txtAttach.Text = objPhieuThuChi.KemTheo;
            //    txtConfirm.Text = objPhieuThuChi.DaNhanDu;
            //}
            //catch (Exception)
            //{

            //}
        }
    }
}
